package jafou.Model;

import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Text;
import com.google.storage.onestore.v3.OnestoreEntity.Reference;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Post {
	
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Long id;
	
	@Persistent
	private String topicId;
	
	@Persistent
	private String userId;
	
	@Persistent
	private Date createdOn;
	
	@Persistent
	private Text message;
	
	@Persistent
	private boolean isDeleted;
	
	@Persistent
	private String userIP;
	
	public Post(String userId, String userIP) {
		this.userId = userId;
		this.userIP = userIP;
		this.createdOn = new Date();
	}

	public Long getId() {
		return id;
	}

	public String getTopicId() {
		return topicId;
	}

	public void setTopicId(String forumId) {
		this.topicId = forumId;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public Date getCreatedOn() {
		return createdOn;
	}

	public void setCreatedOn(Date createdOn) {
		this.createdOn = createdOn;
	}

	public Text getMessage() {
		return message;
	}

	public void setMessage(Text message) {
		this.message = message;
	}

	public boolean isDeleted() {
		return isDeleted;
	}

	public void setDeleted(boolean isDeleted) {
		this.isDeleted = isDeleted;
	}

	public String getUserIP() {
		return userIP;
	}

}
